
// A1_f_statistics
//==============================================================================

// Description: This file computes f-statistics for each product category

clear
set more off

cd "D:\data_replication"


forval i = 1/4092 {

import delimited estimation/4_demand_estimation/3_baseline/data_`i'.csv, clear
gen price_log = log(price_pc8plus)
gen price_iv_log = log(price_ex_own_all_years)
gen population_log = log(population_partner)

gen pardec = declarant * 1000 + partner 
eststo clear 
xtset pardec 
xtreg price_log price_iv_log, fe vce(robust)
est sto test
qui testparm*
estadd scalar p_value = r(p)
esttab test using statistics_and_graphs/f_statistics/output_files/Fstat_`i'.csv , scalar(F p_value) replace
}


